<template>
	<!-- <div class="panel-box"> -->
	<div class="left-box">
		<div class="heade-wrapper">
			<a-input-search
				class="last-input-box"
				:placeholder="this.$i18n('selectPeople.input.not.name')+this.$i18n('common.node.name.label')"
				v-model.trim="searchValue"
				@search="searchHandle"
			/>
		</div>
		<div class="content-wrapper">
			<scroll-list
				panel="WF_SUPER_NODE"
				command="nodeList"
				ref="scrollList"
				:initSearchValue="initSearchValue"
				iconType="cap-icon-alternative-supernode"
			/>
		</div>
	</div>
</template>

<script>
import accountSelector from '@/components/accountSelector';
import scrollList from '@/components/scrollList';

export default {
	name: 'theSuperNode',
	inject: ['app'],
	components: { accountSelector, scrollList },
	data() {
		return {
			searchValue: '',
			selectAccountId: '',
			initSearchValue: {},

			accountTreeDisabled: true
		};
	},
	watch: {},
	computed: {
		extParameters() {
			return this.app().orgSelect.extParameters;
		}
	},
	beforeMount() {
		const { extParameters } = this.app().orgSelect;
		this.initSearchValue = {
			keyword: this.searchValue,
			extParameters: extParameters
		};
	},
	methods: {
		onChangeAccount(ret) {
			this.initProps();
			this.selectAccountId = ret.id;
			this.searchHandle();
		},
		initProps() {
			this.searchValue = '';
		},
		searchHandle() {
			this.$refs.scrollList.search({
				keyword: this.searchValue,
				extParameters: this.extParameters
			});
		}
	}
};
</script>

<style lang="scss" scoped>
</style>
